﻿using System;
using XmlVisualizer.Views;
using XmlVisualizer.Controllers;
using XmlVisualizer.Models;

namespace XmlVisualizer.Controllers
{
    /// <summary>
    /// Interface that every controller in the application must implement;
    /// defines basic actions that can be done in this application.
    /// </summary>
    public interface IController
    {
        void View_NewFile();
        void View_OpenFile(String filename);
        void View_SaveFile(String filename);
        void View_Undo();
        void View_Redo();
        void View_Settings();
        void View_Exit();
    };
}

namespace XmlVisualizer.Models
{
    /// <summary>
    /// Abstract base class for all the models
    /// </summary>
    public interface IModel
    {
        void OpenFile(String filename);
        void SaveFile(String filename);
        String GetOuterXml();

        void RegisterObserver(Observer controller);
        void RemoveObserver(Observer controller);
    };
}

namespace XmlVisualizer.Views
{
    public interface Observer
    {
        void notify();
        void showFile();
        void unexpectedShutdownNotify();
    };

    /// <summary>
    /// Interface for the view
    /// In application, the window implements this interface, so the methods have access to
    /// the visual elements.
    /// </summary>
    public interface IView
    {
        void NewFile();
        void OpenFile();
        void SaveFile();
        void Undo();
        void Redo();
        void Settings();
        void Exit();
    };
}

namespace DiagramDesigner
{
    public interface IGroupable
    {
        Guid ID { get; }
        Guid ParentID { get; set; }
        bool IsGroup { get; set; }
    }

    // Common interface for items that can be selected
    // on the DesignerCanvas; used by DesignerItem and Connection
    public interface ISelectable
    {
        bool IsSelected { get; set; }
    }
}